gObject = global.Object;

function Canvas() {
    this.tagName = 'CANVAS';
    this.style = {};
}
function CanvasRenderingContext2D() {
    this.style = {
        display: ''
    };
}
CanvasRenderingContext2D.prototype.fillRect = function fillRect() {}
CanvasRenderingContext2D.prototype.fillText = function fillText() {}

var WebGLDebugRendererInfo = {
    'UNMASKED_VENDOR_WEBGL': 37445,
    'UNMASKED_RENDERER_WEBGL': 37446,
}

function WebGLRenderingContext() {}
WebGLRenderingContext.prototype.getExtension = function getExtension() {
    if (arguments[0] == 'WEBGL_debug_renderer_info') {
        return WebGLDebugRendererInfo;
    }
}
WebGLRenderingContext.prototype.getParameter = function getParameter(pname) {
    
    switch (pname) {
        case WebGLDebugRendererInfo.UNMASKED_VENDOR_WEBGL:
            return 'Google Inc.';
        case WebGLDebugRendererInfo.UNMASKED_RENDERER_WEBGL:
            return 'ANGLE (Intel(R) UHD Graphics 630 Direct3D11 vs_5_0 ps_5_0)';
    }

    return null;
}

Canvas.prototype.getAttributeNames = function getAttributeNames() {
    return [];
}
Canvas.prototype.getContext = function getContext(a) {
    if (a == 'webgl' || a == 'experimental-webgl') {
        return new WebGLRenderingContext();
    }
    return new CanvasRenderingContext2D();
}
Canvas.prototype.toDataURL = function toDataURL() {
    return '';
}

function Span() {
    this.tagName = 'SPAN';
    this.style = {};
    this.offsetHeight = 0;
    this.offsetWidth = 0;
    
    gObject.defineProperty(this, 'offsetWidth', {
        get: () => {
            if (this.style.fontFamily == 'monospace') {
                return 468;
            } else if (this.style.fontFamily == 'sans-serif') {
                return 732;
            } else if (this.style.fontFamily == 'serif') {
                return 468;
            }
            console.log('获取宽度', this.style);
            return 0;
        }
    });

    
    gObject.defineProperty(this, 'offsetHeight', {
        get: () => {
            if (this.style.fontFamily == 'monospace') {
                return 72;
            } else if (this.style.fontFamily == 'sans-serif') {
                return 95;
            } else if (this.style.fontFamily == 'serif') {
                return 72;
            }
            return 0;
        }
    });
}

function B() {
    this.tagName = 'B';
}

function Div() {
    var that = this;
    this.tagName = 'DIV';
    this.childNodes = [];
    gObject.defineProperty(this, 'innerHTML', {
        set: (html) => {
            // let len = html.match(/<span style=\"(.*?)\">(.*?)<\/span>/g).length;
            that.childNodes = [{"offsetWidth":494,"offsetHeight":72},{"offsetWidth":477,"offsetHeight":72},{"offsetWidth":494,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":74},{"offsetWidth":732,"offsetHeight":74},{"offsetWidth":468,"offsetHeight":74},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":752,"offsetHeight":88},{"offsetWidth":752,"offsetHeight":88},{"offsetWidth":752,"offsetHeight":88},{"offsetWidth":429,"offsetHeight":75},{"offsetWidth":430,"offsetHeight":75},{"offsetWidth":430,"offsetHeight":75},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":735,"offsetHeight":82},{"offsetWidth":734,"offsetHeight":82},{"offsetWidth":735,"offsetHeight":82},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":719,"offsetHeight":86},{"offsetWidth":718,"offsetHeight":86},{"offsetWidth":719,"offsetHeight":86},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":709,"offsetHeight":87},{"offsetWidth":708,"offsetHeight":87},{"offsetWidth":708,"offsetHeight":87},{"offsetWidth":653,"offsetHeight":94},{"offsetWidth":653,"offsetHeight":94},{"offsetWidth":652,"offsetHeight":94},{"offsetWidth":459,"offsetHeight":80},{"offsetWidth":458,"offsetHeight":80},{"offsetWidth":458,"offsetHeight":80},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":658,"offsetHeight":72},{"offsetWidth":659,"offsetHeight":72},{"offsetWidth":658,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":760,"offsetHeight":87},{"offsetWidth":759,"offsetHeight":87},{"offsetWidth":760,"offsetHeight":87},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":583,"offsetHeight":72},{"offsetWidth":583,"offsetHeight":72},{"offsetWidth":583,"offsetHeight":72},{"offsetWidth":936,"offsetHeight":72},{"offsetWidth":936,"offsetHeight":72},{"offsetWidth":936,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":742,"offsetHeight":81},{"offsetWidth":741,"offsetHeight":81},{"offsetWidth":742,"offsetHeight":81},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":564,"offsetHeight":82},{"offsetWidth":564,"offsetHeight":82},{"offsetWidth":564,"offsetHeight":82},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":499,"offsetHeight":79},{"offsetWidth":498,"offsetHeight":79},{"offsetWidth":498,"offsetHeight":79},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":532,"offsetHeight":81},{"offsetWidth":531,"offsetHeight":81},{"offsetWidth":531,"offsetHeight":81},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":443,"offsetHeight":72},{"offsetWidth":442,"offsetHeight":72},{"offsetWidth":443,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":723,"offsetHeight":95},{"offsetWidth":723,"offsetHeight":95},{"offsetWidth":723,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":605,"offsetHeight":81},{"offsetWidth":604,"offsetHeight":81},{"offsetWidth":605,"offsetHeight":81},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":686,"offsetHeight":84},{"offsetWidth":686,"offsetHeight":84},{"offsetWidth":686,"offsetHeight":84},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":733,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":625,"offsetHeight":88},{"offsetWidth":625,"offsetHeight":88},{"offsetWidth":625,"offsetHeight":88},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":672,"offsetHeight":96},{"offsetWidth":673,"offsetHeight":96},{"offsetWidth":672,"offsetHeight":96},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":792,"offsetHeight":101},{"offsetWidth":792,"offsetHeight":101},{"offsetWidth":792,"offsetHeight":101},{"offsetWidth":515,"offsetHeight":84},{"offsetWidth":514,"offsetHeight":84},{"offsetWidth":515,"offsetHeight":84},{"offsetWidth":487,"offsetHeight":72},{"offsetWidth":488,"offsetHeight":72},{"offsetWidth":487,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":699,"offsetHeight":89},{"offsetWidth":698,"offsetHeight":89},{"offsetWidth":699,"offsetHeight":89},{"offsetWidth":675,"offsetHeight":86},{"offsetWidth":674,"offsetHeight":86},{"offsetWidth":675,"offsetHeight":86},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":733,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":733,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":427,"offsetHeight":85},{"offsetWidth":426,"offsetHeight":85},{"offsetWidth":427,"offsetHeight":85},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":687,"offsetHeight":95},{"offsetWidth":687,"offsetHeight":95},{"offsetWidth":686,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":733,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":748,"offsetHeight":82},{"offsetWidth":748,"offsetHeight":82},{"offsetWidth":748,"offsetHeight":82},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":575,"offsetHeight":72},{"offsetWidth":574,"offsetHeight":72},{"offsetWidth":574,"offsetHeight":72},{"offsetWidth":644,"offsetHeight":86},{"offsetWidth":644,"offsetHeight":86},{"offsetWidth":644,"offsetHeight":86},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":701,"offsetHeight":89},{"offsetWidth":701,"offsetHeight":89},{"offsetWidth":700,"offsetHeight":89},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":735,"offsetHeight":111},{"offsetWidth":734,"offsetHeight":111},{"offsetWidth":735,"offsetHeight":111},{"offsetWidth":835,"offsetHeight":76},{"offsetWidth":834,"offsetHeight":76},{"offsetWidth":835,"offsetHeight":76},{"offsetWidth":468,"offsetHeight":72},{"offsetWidth":732,"offsetHeight":95},{"offsetWidth":468,"offsetHeight":72}];
        }
    })
}


let window = {}
let document = {};
let navigator = {};
let screen = {};
let location = {};


navigator.hardwareConcurrency = 12;
navigator.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36';
navigator.language = 'zh-CN';
navigator.userLanguage = null;
navigator.platform = 'Win32';

function Plugin(name) {
    this.name = name
}

navigator.plugins = [
    new Plugin('Chrome PDF Plugin'),
    new Plugin('Chrome PDF Viewer'),
    new Plugin('Native Client'),
];

navigator.getBattery = function() {
    return new Promise((resolve, reject) => {
        resolve({
            charging: true,
            chargingTime: 0,
            dischargingTime: Infinity,
            level: 1,
            onchargingchange: null,
            onchargingtimechange: null,
            ondischargingtimechange: null,
            onlevelchange: null
        })
    });
}

document.createElement = function createElement(tag) {
    switch (tag) {
        case 'canvas':
            return new Canvas();
        case 'span':
            return new Span();
        case 'b':
            return new B();
        case 'div':
            return new Div();
    }

    return null;
}


document.getElementById = function getElementById() {}
document.getElementsByTagName = function getElementsByTagName(tag) {
    if (tag == 'a') {
        return Array(9);
    } else if (tag == 'input') {
        return Array(43);
    } else if (tag == 'button') {
        return Array(2);
    } else if (tag == 'script') {
        return Array(38);
    } else if (tag == 'body') {
        return [document.body];
    }
}

document.wasDiscarded = false;
document.charset = 'GBK';


function Body() {
    this.id = '';
    this.tagName = 'BODY';
    this.clientHeight = 295;
    this.clientWidth = 286;
    this.scrollLeft = 0;
    this.clientLeft = 0;
    this.offsetLeft = 0;
    this.offsetTop = 0;
}
Body.prototype.appendChild = function appendChild() {}
Body.prototype.removeChild = function removeChild() {}
Body.prototype.addBehavior = null;
Body.prototype.dispatchEvent = function dispatchEvent(event) {
    // console.log('dispatchEvent', events[event.type].toString());
    window.event = event;
    events[event.type].apply(event.view, [event]);
}
document.body = new Body();


document.webkitHidden = false;
// document.createTouch = null;

var events = {};

document.addEventListener = function addEventListener(event, func, useCapture) {
    // console.log('document.addEventListener', { event });
    events[event] = func;
}

document.compatMode = 'CSS1Compat';


function Element() {}
Element.prototype.webkitMatchesSelector = function() {}
window.Element = Element


function RTCPeerConnection() {}
window.webkitRTCPeerConnection = RTCPeerConnection;

window.mozPaintCount = null;
window.mozInnerScreenX = null;
window.Debug = null;
window.WebKitPlaybackTargetAvailabilityEvent = null;

function Touch() {}
window.Touch = Touch;

function Proxy() {}
window.Proxy = Proxy;


function Symbol() {}
Symbol.hasOwnProperty = function hasOwnProperty() {};
Symbol.hasOwnProperty.match = null;
Symbol.species = 'Symbol(Symbol.species)';
Symbol.toPrimitive = 'Symbol(Symbol.toPrimitive)';
Symbol.hasInstance = 'Symbol(Symbol.hasInstance)';
window.Symbol = Symbol;



// function Object() {}
// Object.keys = function keys(obj) {
//     var arr = [];
//     for (let key in obj) {
//         arr.push(key);
//     }
//     return arr;
// }
// Object.values = function values() {}
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(obj, prop) {
    // console.log('Object.getOwnPropertyDescriptor', { prop });
    return null;
}
window.Object = Object;
global.Object = Object;

function OfflineAudioContext() {}
OfflineAudioContext.prototype.close = null;
window.OfflineAudioContext = OfflineAudioContext;

// console.log(window.OfflineAudioContext.prototype.close)

function PointerEvent() {}
PointerEvent.prototype.getCoalescedEvents = function getCoalescedEvents() {}
window.PointerEvent = PointerEvent;



window.BudgetService = null;


function Performance() {
    this.timeOrigin = Date.now() + parseInt(Math.random() * 1000) / 1000;
}
window.performance = new Performance();


// console.log(document.createElement.getAttributeNames);
var Intl = {};
Intl.PluralRules = function PluralRules() {}
window.Intl = Intl;



window.getMatchedCSSRules = null;



function PerformanceServerTiming() {}
window.PerformanceServerTiming = PerformanceServerTiming;


function BigInt() {}
window.BigInt = BigInt;


var Reflect = {};
window.Reflect = Reflect;


function WeakMap() {}
WeakMap.prototype.clear = null;
window.WeakMap = WeakMap;

function DOMTokenList() {}
DOMTokenList.prototype.replace = function replace() {}
window.DOMTokenList = DOMTokenList;



window.isSecureContext = true;

window.self = window;


function PerformanceTiming() {}
PerformanceTiming.prototype.secureConnectionStart = null;
window.PerformanceTiming = PerformanceTiming;



// window.showModalDialog = null;


function HTMLDocument() {}
HTMLDocument.prototype.getSelection = function getSelection() {}
window.HTMLDocument = HTMLDocument;


function HTMLMediaElement() {}
HTMLMediaElement.prototype.mozAutoplayEnabled = null;
window.HTMLMediaElement = HTMLMediaElement;


function jQuery() {};
jQuery.fn = {};
jQuery.fn.jquery = '1.7.2';
window.jQuery = jQuery;


let seajs = {};
seajs.version = '2.2.3';
window.seajs = seajs;


function Notification() {}
Notification.permission = 'denied';
window.Notification = Notification;


function MediaStreamTrackEvent() {}
window.MediaStreamTrackEvent = MediaStreamTrackEvent;


function DragEvent() {}
window.DragEvent = DragEvent;


function CredentialsContainer() {}
window.CredentialsContainer = CredentialsContainer;


// window.maxConnectionsPerServer = null;
// window.AudioTrackList = null;


function RTCDTMFToneChangeEvent() {}
window.RTCDTMFToneChangeEvent = RTCDTMFToneChangeEvent;


function XMLHttpRequest() {}
window.XMLHttpRequest = XMLHttpRequest;


function CacheStorage() {}
window.caches = CacheStorage;


function PerformanceObserver() {}
window.PerformanceObserver = PerformanceObserver;


// window.opr = null;
// window.__sogou_secure_input = null;
// window.kws_checkVirus = null;
window.phantom = null;
window.callPhantom = null;
window._phantom = null;
window.ClientUtils = null;
document.$cdc_asdjflasutopfhvcZLmcfl_ = null;
document.__webdriver_script_fn = null;
window.webdriver = null;
window.domAutomation = null;
window.Buffer = null;
window.emit = null;
window.spawn = null;
navigator.webdriver = null;
window.fmget_targets = null;
window.__nightmare = null;
navigator.appVersion = '5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36'
function HTMLHtmlElement() {}
HTMLHtmlElement.getAttribute = function getAttribute(a) {
    // console.log('HTMLHtmlElement.getAttribute', { a });
    return null;
}
document.documentElement = HTMLHtmlElement;

delete window.DTRACE_NET_STREAM_END;
delete window.Buffer;
delete global.Buffer;

navigator.requestMIDIAccess = function() {
    return new Promise((resolve, reject) => {
        reject("Failed to execute 'requestMIDIAccess' on 'Navigator': Midi has been disabled in this document by Feature Policy.");
    })
}

window.ActiveXObject = undefined;
window.postMessage = function postMessage() {
    console.log('window.postMessage');
}


// window.Error = function Error() {}
gObject.defineProperty(window, 'Error', {
    get: function() {
        // console.log('获取Error构造函数');
        return function Error() {
            // console.log('Error初始化完毕, 修改stack');
            // this.stack = "Error\n    at ja (https://gw.alipayobjects.com/os/fraudmng/IatYdcGPoYCvonQkojlT.js:1:103238)\n    at Object.w (https://gw.alipayobjects.com/os/fraudmng/IatYdcGPoYCvonQkojlT.js:1:250458)\n    at Dc (https://gw.alipayobjects.com/os/fraudmng/IatYdcGPoYCvonQkojlT.js:1:205079)\n    at Object.w (https://gw.alipayobjects.com/os/fraudmng/IatYdcGPoYCvonQkojlT.js:1:250458)\n    at String.window.<computed>.toString (https://gw.alipayobjects.com/os/fraudmng/IatYdcGPoYCvonQkojlT.js:1:120680)\n    at <anonymous>:1:16";
            this.stack = "Error\n    at _r (https://gw.alipayobjects.com/os/fraudmng/rNtbgPOGUOpwDQQrAMVH.js:1:158372)\n    at Object.n (https://gw.alipayobjects.com/os/fraudmng/rNtbgPOGUOpwDQQrAMVH.js:1:16212)\n    at ae (https://gw.alipayobjects.com/os/fraudmng/rNtbgPOGUOpwDQQrAMVH.js:1:42396)\n    at Object.n (https://gw.alipayobjects.com/os/fraudmng/rNtbgPOGUOpwDQQrAMVH.js:1:16212)\n    at String.window.<computed>.toString (https://gw.alipayobjects.com/os/fraudmng/rNtbgPOGUOpwDQQrAMVH.js:1:115559)\n    at encodeURIComponent (<anonymous>)\n    at e (https://a.alipayobjects.com/??seajs/seajs/2.2.3/sea.js,seajs/seajs-combo/1.0.0/seajs-combo.js,seajs/seajs-style/1.0.2/seajs-style.js,seajs/seajs-log/1.0.0/seajs-log.js,jquery/jquery/1.7.2/jquery.js,gallery/json/1.0.3/json.js,alipay-request/3.0.8/index.js:6:15209)\n    at b_ (https://a.alipayobjects.com/??seajs/seajs/2.2.3/sea.js,seajs/seajs-combo/1.0.0/seajs-combo.js,seajs/seajs-style/1.0.2/seajs-style.js,seajs/seajs-log/1.0.0/seajs-log.js,jquery/jquery/1.7.2/jquery.js,gallery/json/1.0.3/json.js,alipay-request/3.0.8/index.js:4:1999)\n    at Function.param (https://a.alipayobjects.com/??seajs/seajs/2.2.3/sea.js,seajs/seajs-combo/1.0.0/seajs-combo.js,seajs/seajs-style/1.0.2/seajs-style.js,seajs/seajs-log/1.0.0/seajs-log.js,jquery/jquery/1.7.2/jquery.js,gallery/json/1.0.3/json.js,alipay-request/3.0.8/index.js:6:15383)\n    at a (https://a.alipayobjects.com/??seajs/seajs/2.2.3/sea.js,seajs/seajs-combo/1.0.0/seajs-combo.js,seajs/seajs-style/1.0.2/seajs-style.js,seajs/seajs-log/1.0.0/seajs-log.js,jquery/jquery/1.7.2/jquery.js,gallery/json/1.0.3/json.js,alipay-request/3.0.8/index.js:9:711)";
        };
    }
})


document.hasOwnProperty = function hasOwnProperty(a) {
    if ([].indexOf(a) > -1) {
        return false;
    }
    // console.log('document.hasOwnProperty', { a });

    return false;
}

window.hasOwnProperty = function hasOwnProperty(a) {
    if (['ubot', 'awesomium'].indexOf(a) > -1) {
        return false;
    }
    // console.log('window.hasOwnProperty', { a });
    return false;
}

window.addEventListener = function addEventListener(event, func, useCapture) {
    // console.log('window.addEventListener', { event });
}


// 测试
window.top = null

window.devicePixelRatio = 1;


window.performance = {}

// JSON.stringify(window.performance.getEntries([]).filter(d => d.initiatorType != null).map(d => {
//     return {
//         initiatorType: d.initiatorType,
//         requestStart: d.requestStart,
//         responseEnd: d.responseEnd,
//     };
// }))
window.performance.getEntries = function getEntries() {
    return [{"initiatorType":"navigation","requestStart":2.789999998640269,"responseEnd":153.40999999898486},{"initiatorType":"link","requestStart":158.6200000019744,"responseEnd":190.41999999899417},{"initiatorType":"script","requestStart":162.05499999341555,"responseEnd":193.65000000107102},{"initiatorType":"script","requestStart":162.50000000582077,"responseEnd":194.09999999334104},{"initiatorType":"script","requestStart":162.86499999114312,"responseEnd":203.03999999305233},{"initiatorType":"script","requestStart":163.05000000284053,"responseEnd":207.57500000763685},{"initiatorType":"script","requestStart":163.1000000052154,"responseEnd":198.74500000150874},{"initiatorType":"script","requestStart":163.51499999291264,"responseEnd":201.42999998643063},{"initiatorType":"script","requestStart":163.72000001138076,"responseEnd":231.64000001270324},{"initiatorType":"script","requestStart":163.86500000953674,"responseEnd":230.0600000016857},{"initiatorType":"img","requestStart":0,"responseEnd":379.9050000088755},{"initiatorType":"img","requestStart":280.35499999532476,"responseEnd":439.909999986412},{"initiatorType":"script","requestStart":277.9049999953713,"responseEnd":308.9050000126008},{"initiatorType":"script","requestStart":0,"responseEnd":306.3599999877624},{"initiatorType":"script","requestStart":278.4950000059325,"responseEnd":309.12499999976717},{"initiatorType":"script","requestStart":279.76000000489876,"responseEnd":309.2799999867566},{"initiatorType":"img","requestStart":0,"responseEnd":305.36500000744127},{"initiatorType":"css","requestStart":281.90500001073815,"responseEnd":306.2250000075437},{"initiatorType":"css","requestStart":314.9299999931827,"responseEnd":441.65500000235625},{"initiatorType":"script","requestStart":0,"responseEnd":463.2299999939278},{"initiatorType":"script","requestStart":340.5100000090897,"responseEnd":371.47000001277775},{"initiatorType":"img","requestStart":0,"responseEnd":384.6600000106264},{"initiatorType":"script","requestStart":373.95000000833534,"responseEnd":402.6550000126008},{"initiatorType":"script","requestStart":410.84999998565763,"responseEnd":458.52499999455176},{"initiatorType":"css","requestStart":426.7399999953341,"responseEnd":449.46999999228865},{"initiatorType":"img","requestStart":482.85000000032596,"responseEnd":497.41999999969266},{"initiatorType":"xmlhttprequest","requestStart":907.2049999958836,"responseEnd":1025.9399999922607},{"initiatorType":"img","requestStart":0,"responseEnd":1042.3449999943841},{"initiatorType":"img","requestStart":0,"responseEnd":2408.319999987725},{"initiatorType":"img","requestStart":0,"responseEnd":3409.940000012284}];
}


navigator.maxTouchPoints = 0;
navigator.msMaxTouchPoints = null;

window.chrome = {}

navigator.cookieEnabled = true;

// 这个参数是支付宝独有的
window.alipay = {};

navigator.onLine = true;
window.localStorage = function Storage() {}
window.sessionStorage = function Storage() {}
window.indexedDB = function IDBFactory() {}
navigator.doNotTrack = null;

navigator.javaEnabled = function javaEnabled() {
    return false;
}

window.openDatabase = function() {}

window.fetch = function fetch() {}

navigator.bluetooth = function Bluetooth() {}

window.ScriptEngineBuildVersion = null;
window.ScriptEngineMajorVersion = null;
window.ScriptEngineMinorVersion = null;



// 这个参数最小化时为负数
window.screenTop = 0;
window.screenY = 0;


function MouseEvent() {}
MouseEvent.prototype.initMouseEvent = function initMouseEvent(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
    this.type = type;
    this.canBubble = canBubble;
    this.cancelable = cancelable;
    this.view = view;
    this.detail = detail;
    this.screenX = screenX;
    this.screenY = screenY;
    this.clientX = clientX;
    this.clientY = clientY;
    this.ctrlKey = ctrlKey;
    this.altKey = altKey;
    this.shiftKey = shiftKey;
    this.metaKey = metaKey;
    this.button = button;
    this.relatedTarget = relatedTarget;
    this.target = document.body;
    this.srcElement = document.body;
    this.x = clientX;
    this.y = clientY;
}
window.MouseEvent = MouseEvent;

document.createEvent = function createEvent(name) {
    switch (name) {
        case 'MouseEvents':
            return new MouseEvent();
    }

    console.log('document.createEvent', { name });
    return null;
}



screen.colorDepth = 24;
screen.deviceXDPI = null;
screen.width = 1920;
screen.height = 1080;


window.navigator = navigator;
window.screen = screen;
window.location = location;
window.document = document;
window.window = window;
global.document = document;
global.navigator = navigator;
global.window = window;
global.location = location;


delete document.documentMode;
delete window.screen.logicalXDPI;
delete window.screen.deviceXDPI;
delete navigator.cpuClass;
delete window.DocumentTouch;
delete window.screen.fontSmoothingEnabled;


// module.exports = {}
